<?
/*
$koatuu_table = 'CC_GEO_OBJECT o, CC_GEO_PROPERTY p';

$res = array();
//dbdebug();

$id = gccHuuid(param('parent'));

while ($id && $d = datafetch('db_item', $koatuu_table, 
	"o.property_id=p.id AND o.id=$id", 'o.id id, p.koatuu_name name, o.parent_id parent_id')) {
	
	$res[] = array('id' => $d['id'], 'name' => $d['name']);
	$id = $d['parent_id'];
}
*/



header("Content-Type: application/json; charset=utf-8");
print json_encode(gccGeoToRoot(param('parent')));

exit;